package com.example.tedtalksimproved.loader;

import android.util.Log;

public class VideoInfo {
	
	private String title;
	private String image_url;
	private String author;
	private String duration;
	private String date;
	private String category;
	private String description;
	private String video;
	private boolean favorite;

	public VideoInfo(String image_url,
			String duration, String date, String category,String description, String video) {
		super();
		this.image_url = image_url;
		this.duration = duration;
		this.date = date.substring(0, date.length()-6);
		this.category = category;
		this.description = description;
		this.video = video;
	}

	public String getAuthor() {
		return author;
	}

	public String getDuration() {
		return duration;
	}

	public String getDate() {
		return date;
	}

	public String getCategory() {
		return category;
	}

	public String getTitle() {
		return title;
	}

	public String getImage_url() {
		return image_url;
	}
	
	public String getVideoURL() {
		return video;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setTitleAndAuthor(String subtitle){
		Log.i("Subtitle", subtitle);
		String[] both = subtitle.split(": "); 
		if(both.length==2){
			this.title = both[1];
			this.author = both[0];
		}else{
			this.title = both[0];
			this.author = " - ";
		}

	}

	public void setFavorite(boolean isit){
		this.favorite = isit;
	}
	
	public boolean isFavorite(){
		if(favorite) return true;
		else return false;
	}
}
